
<template>
  <div class="smd-pop-bottom" :class="[showFloating?'smd-pop-bottom-t':'smd-pop-bottom-o']">
    <div class="pop-bottom-title">
      <span>{{popBottomTitle}}</span>
      <p class="pop-bottom-close" @click="closePopBottom"></p>
    </div>
    <slot></slot>
  </div>
</template>

<script>
export default {
  name: 'PopBottom',
  props: {
    showFloating: {
      type: Boolean,
      default: false
    },
    popBottomTitle: {
      type: String,
      default: ''
    }
  },
  methods: {
    closePopBottom () {
      this.$emit('closePopBottom')
    }
  }
}
</script>
<style lang="less"  rel="stylesheet/less" scope type="text/less">
@r: 100;
.smd-pop-bottom {
  width: 100%;
  height: 641rem / @r;
  background-color: #fff;
  position: fixed;
  bottom: 0;
  max-width: 750px;
  border-radius: 10rem / @r 10rem / @r 0px 0px;
  z-index: 1500;
  transition: transform 0.5s;
  .pop-bottom-title {
    font-size: 40rem / @r;
    height: 136rem / @r;
    line-height: 136rem / @r;
    color: #333;
    font-weight: 600;
    position: relative;
    border-bottom: 1px solid #eeeeee;
    .pop-bottom-close {
      width: 60rem / @r;
      height: 60rem / @r;
      position: absolute;
      right: 30rem / @r;
      top: 50%;
      box-sizing: border-box;
      transform: translateY(-50%);
    }
    .pop-bottom-close::before {
      content: '';
      width: 32rem / @r;
      height: 32rem / @r;
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      background-image: url();
      background-repeat: no-repeat;
      -webkit-background-size: cover;
      background-size: cover;
    }
  }
}
.smd-pop-bottom-t {
  transform: translate(0, 0);
  left: 0;
  right: 0;
  opacity: 1;
}
.smd-pop-bottom-o {
  transform: translate(0, 150%) translateZ(0);
  left: 0;
  right: 0;
  opacity: 0;
}
</style>